package com.personal.system.controller.seckill;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.personal.common.result.Result;
import com.personal.system.entity.seckill.SeckillOrder;
import com.personal.system.entity.seckill.SeckillOrderVo;
import com.personal.system.service.SeckillOrderService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/order")
public class SeckillOrderController {

    @Resource
    private SeckillOrderService orderService;

    @RequestMapping("/detail/{page}/{limit}")
    public Result detail(@PathVariable Long page, @PathVariable Long limit) {
        Page<SeckillOrderVo> pageParam = new Page<>(page, limit);
        IPage<SeckillOrderVo> list = orderService.detail(pageParam);
        return Result.ok(list);
    }

}
